#!/bin/sh
# Copyright (C) 2004-2024 GraphicsMagick Group
. ./common.shi
. ${top_srcdir}/tests/common.shi

# Test program
rwblob=./rwblob

# Types we will test
check_types='bilevel gray palette truecolor'

# Number of tests we plan to run
test_plan_fn 221

# AAI format
for type in ${check_types}
do
  test_command_fn "AAI ${type}" ${MEMCHECK} ${rwblob} "${SRCDIR}/input_${type}.miff" AAI
done

# ART format
for type in ${check_types}
do
  test_command_fn "ART ${type}" ${MEMCHECK} ${rwblob} "${SRCDIR}/input_${type}.miff" ART
done

# AVS format
for type in ${check_types}
do
  test_command_fn "AVS ${type}" ${MEMCHECK} ${rwblob} "${SRCDIR}/input_${type}.miff" AVS
done

# BMP format
for type in ${check_types}
do
  test_command_fn "BMP ${type}" ${MEMCHECK} ${rwblob} "${SRCDIR}/input_${type}.miff" BMP
done
# Special test to verify that lower-case magick works
test_command_fn "BMP truecolor" ${MEMCHECK} ${rwblob} "${SRCDIR}/input_${type}.miff" bmp

# BMP2 format
for type in ${check_types}
do
  test_command_fn "BMP2 ${type}" ${MEMCHECK} ${rwblob} "${SRCDIR}/input_${type}.miff" BMP2
done

# BMP3 format
for type in ${check_types}
do
  test_command_fn "BMP3 ${type}" ${MEMCHECK} ${rwblob} "${SRCDIR}/input_${type}.miff" BMP3
done

# CALS format
for type in ${check_types}
do
  test_command_fn "CALS ${type}" -F TIFF ${MEMCHECK} ${rwblob} "${SRCDIR}/input_${type}.miff" CALS
done

# CIN format
for type in ${check_types}
do
  test_command_fn "CIN ${type}" ${MEMCHECK} ${rwblob} "${SRCDIR}/input_${type}.miff" CIN
done

# DIB format
for type in ${check_types}
do
  test_command_fn "DIB ${type}" ${MEMCHECK} ${rwblob} "${SRCDIR}/input_${type}.miff" DIB
done

# DPX format
for type in ${check_types}
do
  test_command_fn "DPX ${type}" ${MEMCHECK} ${rwblob} "${SRCDIR}/input_${type}.miff" DPX
done

# EPDF format
for type in ${check_types}
do
  test_command_fn "EPDF ${type}" -F 'PS' ${MEMCHECK} ${rwblob} "${SRCDIR}/input_${type}.miff" EPDF
done

# EPT format
for type in ${check_types}
do
  test_command_fn "EPT ${type}" -F 'PS TIFF' ${MEMCHECK} ${rwblob} "${SRCDIR}/input_${type}.miff" EPT
done

# FAX format
for type in ${check_types}
do
  test_command_fn "FAX ${type}" ${MEMCHECK} ${rwblob} "${SRCDIR}/input_${type}.miff" FAX
done

# FPX format
for type in ${check_types}
do
  test_command_fn "FPX ${type}" -F FPX ${MEMCHECK} ${rwblob} "${SRCDIR}/input_${type}.miff" FPX
done

# G3 format
for type in ${check_types}
do
  test_command_fn "G3 ${type}" ${MEMCHECK} ${rwblob} "${SRCDIR}/input_${type}.miff" G3
done

# FITS format
for type in ${check_types}
do
  test_command_fn "FITS ${type}" ${MEMCHECK} ${rwblob} "${SRCDIR}/input_${type}.miff" FITS
done

# GIF format
for type in ${check_types}
do
  test_command_fn "GIF ${type}" ${MEMCHECK} ${rwblob} "${SRCDIR}/input_${type}.miff" GIF
done

# GIF87 format
for type in ${check_types}
do
  test_command_fn "GIF87 ${type}" ${MEMCHECK} ${rwblob} "${SRCDIR}/input_${type}.miff" GIF87
done

# HRZ format
for type in ${check_types}
do
  test_command_fn "HRZ ${type}" ${MEMCHECK} ${rwblob} "${SRCDIR}/input_${type}.miff" HRZ
done

# JBIG format
for type in ${check_types}
do
  test_command_fn "JBIG ${type}" -F JBIG ${MEMCHECK} ${rwblob} "${SRCDIR}/input_${type}.miff" JBIG
done

# JPEG format
for type in ${check_types}
do
  test_command_fn "JPEG ${type}" -F JPEG ${MEMCHECK} ${rwblob} "${SRCDIR}/input_${type}.miff" JPEG
done

# JP2 format
for type in ${check_types}
do
  test_command_fn "JP2 ${type}" -F JP2 ${MEMCHECK} ${rwblob} "${SRCDIR}/input_${type}.miff" JP2
done

# MAT format
for type in ${check_types}
do
  test_command_fn "MAT ${type}" ${MEMCHECK} ${rwblob} "${SRCDIR}/input_${type}.miff" MAT
done

# MIFF format
for type in ${check_types}
do
  test_command_fn "MIFF ${type}" ${MEMCHECK} ${rwblob} "${SRCDIR}/input_${type}.miff" MIFF
done

# MNG format
for type in ${check_types}
do
  test_command_fn "MNG ${type}" -F PNG ${MEMCHECK} ${rwblob} "${SRCDIR}/input_${type}.miff" MNG
done

# MTV format
for type in ${check_types}
do
  test_command_fn "MTV ${type}" ${MEMCHECK} ${rwblob} "${SRCDIR}/input_${type}.miff" MTV
done

# P7 format
for type in ${check_types}
do
  test_command_fn "P7 ${type}" ${MEMCHECK} ${rwblob} "${SRCDIR}/input_${type}.miff" P7
done

# PBM format
for type in ${check_types}
do
  test_command_fn "PBM ${type}" ${MEMCHECK} ${rwblob} "${SRCDIR}/input_${type}.miff" PBM
done

# PCD format
for type in ${check_types}
do
  test_command_fn "PCD ${type}" ${MEMCHECK} ${rwblob} "${SRCDIR}/input_${type}.miff" PCD
done

# PCDS format
for type in ${check_types}
do
  test_command_fn "PCDS ${type}" ${MEMCHECK} ${rwblob} "${SRCDIR}/input_${type}.miff" PCDS
done

# PCX format
for type in ${check_types}
do
  test_command_fn "PCX ${type}" ${MEMCHECK} ${rwblob} "${SRCDIR}/input_${type}.miff" PCX
done

# PGM format
for type in ${check_types}
do
  test_command_fn "PGM ${type}" ${MEMCHECK} ${rwblob} "${SRCDIR}/input_${type}.miff" PGM
done

# PGX format
for type in ${check_types}
do
  test_command_fn "PGX ${type}" -F JP2 ${MEMCHECK} ${rwblob} "${SRCDIR}/input_${type}.miff" PGX
done

# PICON format
for type in ${check_types}
do
  test_command_fn "PICON ${type}" ${MEMCHECK} ${rwblob} "${SRCDIR}/input_${type}.miff" PICON
done

# PICT format
for type in ${check_types}
do
  test_command_fn "PICT ${type}" ${MEMCHECK} ${rwblob} "${SRCDIR}/input_${type}.miff" PICT
done

# PNG format
for type in ${check_types}
do
  test_command_fn "PNG ${type}" -F PNG ${MEMCHECK} ${rwblob} "${SRCDIR}/input_${type}.miff" PNG
done

# PPM format
for type in ${check_types}
do
  test_command_fn "PPM ${type}" ${MEMCHECK} ${rwblob} "${SRCDIR}/input_${type}.miff" PPM
done

# PTIF format
for type in ${check_types}
do
  test_command_fn "PTIF ${type}" -F TIFF ${MEMCHECK} ${rwblob} "${SRCDIR}/input_${type}.miff" PTIF
done

# RAS format
for type in ${check_types}
do
  test_command_fn "RAS ${type}" ${MEMCHECK} ${rwblob} "${SRCDIR}/input_${type}.miff" RAS
done

# SGI format
for type in ${check_types}
do
  test_command_fn "SGI ${type}" ${MEMCHECK} ${rwblob} "${SRCDIR}/input_${type}.miff" SGI
done

# SUN format
for type in ${check_types}
do
  test_command_fn "SUN ${type}" ${MEMCHECK} ${rwblob} "${SRCDIR}/input_${type}.miff" SUN
done

# TGA format
for type in ${check_types}
do
  test_command_fn "TGA ${type}" ${MEMCHECK} ${rwblob} "${SRCDIR}/input_${type}.miff" TGA
done

# TIFF format
for type in ${check_types}
do
  test_command_fn "TIFF ${type}" -F TIFF ${MEMCHECK} ${rwblob} "${SRCDIR}/input_${type}.miff" TIFF
done

# TXT format
for type in ${check_types}
do
  test_command_fn "TXT ${type}" ${MEMCHECK} ${rwblob} "${SRCDIR}/input_${type}.miff" TXT
done

# VDA format
for type in ${check_types}
do
  test_command_fn "VDA ${type}" ${MEMCHECK} ${rwblob} "${SRCDIR}/input_${type}.miff" VDA
done

# VICAR format
for type in ${check_types}
do
  test_command_fn "VICAR ${type}" ${MEMCHECK} ${rwblob} "${SRCDIR}/input_${type}.miff" VICAR
done

# VIFF format
for type in ${check_types}
do
  test_command_fn "VIFF ${type}" ${MEMCHECK} ${rwblob} "${SRCDIR}/input_${type}.miff" VIFF
done

# VST format
for type in ${check_types}
do
  test_command_fn "VST ${type}" ${MEMCHECK} ${rwblob} "${SRCDIR}/input_${type}.miff" VST
done

# WBMP format
for type in ${check_types}
do
  test_command_fn "WBMP ${type}" ${MEMCHECK} ${rwblob} "${SRCDIR}/input_${type}.miff" WBMP
done

# WEBP format
for type in ${check_types}
do
  test_command_fn "WEBP ${type}" -F WEBP ${MEMCHECK} ${rwblob} "${SRCDIR}/input_${type}.miff" WEBP
done
for type in ${check_types}
do
  test_command_fn "WEBP ${type} (lossless)" -F WEBP ${MEMCHECK} ${rwblob} -define webp:lossless=true "${SRCDIR}/input_${type}.miff" WEBP
done

# WPG format
for type in ${check_types}
do
  test_command_fn "WPG ${type}" ${MEMCHECK} ${rwblob} "${SRCDIR}/input_${type}.miff" WPG
done

# XBM format
for type in ${check_types}
do
  test_command_fn "XBM ${type}" ${MEMCHECK} ${rwblob} "${SRCDIR}/input_${type}.miff" XBM
done

# XPM format
for type in ${check_types}
do
  test_command_fn "XPM ${type}" ${MEMCHECK} ${rwblob} "${SRCDIR}/input_${type}.miff" XPM
done

# XWD format
for type in ${check_types}
do
  test_command_fn "XWD ${type}" -F X ${MEMCHECK} ${rwblob} "${SRCDIR}/input_${type}.miff" XWD
done

:
